//
//  ViewController.m
//  OutesIOS
//
//  Created by norman on 2018/10/31.
//  Copyright © 2018 norman. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self setupViews];
    // Do any additional setup after loading the view.
}

- (void)setupViews {
    //logo
    UIImageView *logo = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"Outes"]];
    CGFloat scale = logo.width*2/kScreen_Width;
    logo.width = kScreen_Width/2;
    logo.height = logo.height/scale;
    logo.centerX = kScreen_Width/2;
    logo.centerY = kScreen_Height/4;
    
    UIView *logoView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, logo.width+60, logo.height+60)];
    logoView.centerX = kScreen_Width/2;
    logoView.centerY = kScreen_Height/4;
    logoView.layer.cornerRadius = 30;
    logoView.backgroundColor = CM_TABLE_BG_COLOR;
    [self.view addSubview:logoView];
    [self.view addSubview:logo];
    
    //用户名
    UIView *userView = [[UIView alloc]initWithFrame:CGRectMake(15, kScreen_Height/2, kScreen_Width - 30, 40)];
    userView.layer.cornerRadius = 10;
    userView.layer.borderWidth = 0.5f;
    userView.layer.borderColor = CM_TABLE_BG_COLOR.CGColor;
    userView.backgroundColor = [UIColor whiteColor];
    //icon
    UIImageView *icon = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"username"]];
    icon.x = 10;
    icon.centerY = userView.height/2;
    [userView addSubview:icon];
    [self.view addSubview:userView];
    
    //密码
    UIView *pswView = [[UIView alloc]initWithFrame:CGRectMake(15, CGRectGetMaxY(userView.frame) + 15, kScreen_Width - 30, 40)];
    pswView.layer.cornerRadius = 10;
    pswView.backgroundColor = [UIColor whiteColor];
    pswView.layer.borderWidth = 0.5f;
    pswView.layer.borderColor = CM_TABLE_BG_COLOR.CGColor;
    UIImageView *icon1 = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"password"]];
    icon1.x = 10;
    icon1.centerY = pswView.height/2;
    [pswView addSubview:icon1];
    [self.view addSubview:pswView];
    
    //按钮
    UIButton *loginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    
    [loginBtn setTitle:@"登录" forState:UIControlStateNormal];
    loginBtn.titleLabel.font = [UIFont systemFontOfSize:20];
    [loginBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    loginBtn.layer.masksToBounds = YES;
    loginBtn.layer.cornerRadius = 10;
    loginBtn.backgroundColor = CM_ORANGE_COLOR;
    loginBtn.frame = CGRectMake(15, CGRectGetMaxY(pswView.frame) + 15, kScreen_Width - 30, 40);
    [self.view addSubview:loginBtn];
    
}

@end
